package components;

public class WatterProvider {

	private int watterInsideWashingMachine = 0;

	public void addWatter(int watter) {
		while (watterInsideWashingMachine < watter) {
			System.out.println("Adding watter into drum: "+ watterInsideWashingMachine);
			watterInsideWashingMachine = watterInsideWashingMachine + 1;
			try {
				Thread.sleep(3000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}

		}
	}
	public void emptyWatterProvider(){
		removeWatter(0);
	}
	
	public void removeWatter(int watter) {
		while (watterInsideWashingMachine > watter) {
			System.out.println("Removing watter from drum:"
					+ watterInsideWashingMachine);

			watterInsideWashingMachine -= 1;
			try {
				Thread.sleep(5000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}

		}
	}
}
